package com.shxzz.easy12306.services.ticket.remote;

import com.shxzz.easy12306.framework.starter.common.dto.order.CloseTicketOrderReqDTO;
import com.shxzz.easy12306.framework.starter.common.dto.order.TicketOrderCreateReqDTO;
import com.shxzz.easy12306.framework.starter.common.dto.order.TicketOrderDetailRespDTO;
import com.shxzz.easy12306.framework.starter.convention.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 订单服务远程调用
 * @author shxzz
 * @create 2024-03-10-20:14
 */
@FeignClient(value = "easy12306-order-service")
public interface OrderRemoteService {

    /**
     * 车票订单创建
     */
    @PostMapping("/api/order-service/order/ticket/create")
    Result<String> createTicketOrder(@RequestBody TicketOrderCreateReqDTO requestParam);


    /**
     * 关闭订单
     */
    @PostMapping("/api/order-service/order/ticket/close")
    Result<Boolean> closeTicketOrder(@RequestBody CloseTicketOrderReqDTO requestParam);

    /**
     * 根据订单号查询车票订单
     */
    @GetMapping("/api/order-service/order/ticket/query")
    Result<TicketOrderDetailRespDTO> queryTicketOrderByOrderSn(@RequestParam(value = "orderSn") String orderSn);
}
